package com.sharer.last.model.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.sharer.last.base.model.BaseDTO;
import lombok.*;

/**
 * Telegram新消息
 *
 * @ClassName TgMessageDTO
 * @Author wangjin
 * @Date 2023/5/5 20:33
 * @Description
 * @Version 1.0
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
@EqualsAndHashCode(callSuper = true)
public class TgMessageDTO extends BaseDTO {
    @JsonProperty("update_id")
    private String  updateId;
    private Message message;

    @NoArgsConstructor
    @Getter
    @Setter
    @ToString
    public class Message {
        @JsonProperty("message_id")
        private String messageId;
        private From   from;
        private Chat   chat;
        private String date;
        private String text;

        @NoArgsConstructor
        @Getter
        @Setter
        @ToString
        public class From {
            private String  id;
            @JsonProperty("is_bot")
            private Boolean isBot;
            @JsonProperty("first_name")
            private String  firstName;
            private String  username;
            @JsonProperty("language_code")
            private String  languageCode;
        }

        @NoArgsConstructor
        @Getter
        @Setter
        @ToString
        public class Chat {
            private String id;
            @JsonProperty("first_name")
            private String firstName;
            private String username;
            private String type;
        }
    }
}
